let mongoose = require('./db')
let Schema = mongoose.Schema

// 运营
let OperationWorkOrderSchema = Schema({
    WorkOrderNumber: String,  // 工单编号
    equipmentNumber:String,  // 设备编号
    TypeOfWorkOrder:String,  // 工单类型
    WorkOrderMode:String,  // 工单方式
    WorkOrderStatus:String,  // 工单状态
    operationalPeople:String,  // 运营人员
    creationTime:{
        type:Date,
        default: Date.now
    },  // 创建日期
})
// 运维
let OperationAndMaintenanceWorkOrderSchema = Schema({
    WorkOrderNumber: String,  // 工单编号
    equipmentNumber:String,  // 设备编号
    TypeOfWorkOrder:String,  // 工单类型
    WorkOrderMode:String,  // 工单方式
    WorkOrderStatus:String,  // 工单状态
    DevOps:String,  // 运维人员
    creationTime:{
        type:Date,
        default: Date.now
    },  // 创建日期
})

// 商品类型
let TypeOfMerchandiseSchema = Schema({
    commodityName: String,  // 商品类型名称
})
// 商品管理
let CommodityManagementSchema = Schema({
    commodityName: String,  // 商品名称
    commodityImg: String,  // 商品图片
    brand: String,  // 品牌
    specification: String,  // 规格
    commodityPrice :String ,// 商品价格
    commodityType :String ,// 商品类型
    creationTime:{
        type:Date,
        default: Date.now
    },  // 创建日期
}) 

let TypeOfMerchandiseModel = mongoose.model('TypeOfMerchandise',TypeOfMerchandiseSchema,"TypeOfMerchandise")
let OperationWorkOrderModel = mongoose.model('OperationWorkOrder',OperationWorkOrderSchema,"OperationWorkOrder")
let CommodityManagementModel = mongoose.model('CommodityManagement',CommodityManagementSchema,"CommodityManagement")
let OperationAndMaintenanceWorkOrderModel = mongoose.model('OperationAndMaintenanceWorkOrder',OperationAndMaintenanceWorkOrderSchema,"OperationAndMaintenanceWorkOrder")


module.exports = {
    OperationAndMaintenanceWorkOrderModel,
    CommodityManagementModel,
    OperationWorkOrderModel,
    TypeOfMerchandiseModel,
}
